<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
	<meta charset="UTF-8">
	<title>往期活动详情页</title>
	<meta name="page-view-size" content="1280*720">
	<link rel="stylesheet" href="css/base.css">
	<link rel="stylesheet" href="css/voteHasPicture.css">
	<script type="text/javascript" src="lib/js/evm.js"></script>
	<script type="text/javascript" src="lib/js/Evm_djyw.js"></script>
	<script type="text/javascript" src="lib/js/key.js"></script>
	<script src="lib/js/md5.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/api.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/public.js" type="text/javascript" charset="utf-8"></script>
	<style>
		.model:nth-child(4) {
			display: block;
			width: 100px;
			height: 35px;
			position: absolute;
			top: 450px;
			left: 170px;
			text-align: center;
			background: url(../images/like-1.png) no-repeat;
			background-position: top center;
			background-size: 60px 60px;
			padding-top: 80px;
			font-size: 15px;
			color: #fff;
		}
	</style>
</head>

<body>
	<div class="theoretical-bg" id="theoreticalMain">
		<div id="white-bg"></div>
		<div id="blue-bg"></div>
		<div class="model">
			<img class="imgs" src="" alt="">
			<div class="alearts bold">按确认键查看图集</div>
		</div>
		<div class="underImg">
				<div class="erweima">
					<img class="erweimas" src="images/erweima.png" alt="">
					<span class="bold">扫码分享</span>
				</div>
		</div>
		<div class="status"><img src="images/status1.png" alt=""></div>
		<div class="info">
			<div class="title bold"></div>
		</div>
		<div></div>
		<div class="model">
			<div class="container" id="container">
				<div class="content" id="content">

				</div>
			</div>
		</div>

		<div class="model" id="likes">
			<div></div>
			<p class="bold">100</p>
		</div>
		<div class="view" >
			<img class="boximg" src="images/view.png" alt="">
			<p class="bold">100</p>
		</div>


	</div>
</body>
<script>
	var modelIndex = {
		disUser: true,
		specialState: 'didi',
		index: 0, //初始位置
		listName: 'model', //模块名称
		containerId: 'theoreticalMain', //包含模块的标签id
		thisContain: 'container', //翻滚外容器
		thisDetail: 'content', //翻滚内容
	}
	var articleRun;

	function getMessage() {
		var param = {
			id: TV.GetParam('id'),
			area_id: $.cookie('TV_CST_AREA'),
			// access_token: $.cookie("TV_CST_TOKEN"),

		}
		GetDatas('getVoteOption', param, function (err, res) {
			mess = res.data
			console.log(mess,'mess')
			$('.title').html(mess.title);
			$("#likes p").html(mess.likes)
			$(".view p").html(mess.click_count)

			// $('.baotime').html(" <div class=yellow>报名时间</div>: " + mess.format_end_time);
			//          $('.title').html("好人宣德馆文化服务活动");
			$('.endtime').html(" <div class=orange>结束时间</div>: " + mess.format_end_time);
			$('.starttime').html("<img src=" + 'images/time.png' + '>' + " <div class=orange>活动时间</div>: " + mess.format_start_time + ' 至 ' + mess
				.format_end_time);
			$('.organization').html("<img src=" + 'images/team.png' + '>' + '<div class=orange>发起组织</div>：' + mess.group_name)
			$('.address').html("<img src=" + 'images/address.png' + '>' + '<div class=orange>活动地点</div>：' + mess.address);
			$('.serviceTime').html("<img src=" + 'images/time.png' + '>' + '<div class=orange>服务时长</div>：' + mess.service_time);
			$('.phone').html("<img src=" + 'images/phone.png' + '>' + '<div class=orange>联系电话</div>：' + mess.phone);
			// $('.situation').html('<div class=orange>报名情况</div>：已报名' + mess.bm_count + '人/限' + 100 + "人报名");
			$('.contacts').html("<img src=" + 'images/person.png' + '>' + '<div class=orange>联&nbsp;&nbsp;系&nbsp;&nbsp;人&nbsp;</div>: ' + mess.contacter +
				'');
			$('.brief').html("<img src=" + 'images/brief.png' + '>' + '<div class=orange>活动简介</div>：');
			// $('.phone').html('<div class=yellow>联系方式&nbsp;&nbsp;</div>: ' + mess.phone);
			// $('.status').html(mess.status == 0 ? '未开始' : (mess.status == 1 ? '进行中' : '已结束'));



			$('.content').html(mess.content)
			$('.imgs').attr('src', mess.img ? API_URL.imgURL + mess.img : "/images/nonePic.png");

			// $('.').html(mess.);
			var surl = API_URL.loginURL + "home/index/qrcode?url=" + encodeURIComponent(
				API_URL.WXUrlDetail + '/' + TV.GetParam('id'))
			$('.erweimas').attr('src', surl)
			// if(mess.category_name =='公益广告'){
			// 	let str = ''
			// 	str += '<div class="backgrounds"><img class="spe-img" src="'+ API_URL.imgURL+mess.img+'" alt=""></div>'
			// 	$('#theoreticalMain').html(str)
			// }
		})
		// right.toggleFocus();
	}

	getMessage();

	function direOpt(index, directive) {
		if (directive == "up") { //上
			console.log('toptop')
			if (index == 1) { //文章翻滚
				TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
			}
			
			if (index==2) {
				index=0
			}

		} else if (directive == "down") { //下
			console.log('downdown', index)
			if (index == 1) { //文章翻滚
				console.log(directive, modelIndex.thisContain, modelIndex.thisDetail, '21212')
				TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
			}
			if (index==0) {
				index=2
			}

		} else if (directive == "backwards") { //左
			clearInterval(articleRun)

			if (index==1) {
				index=0
			}

		} else if (directive == "forwards") { //右
			
			if (index==0||index==2) {
				index=1
			}
		}
		console.log(index)
		return index;
	}

	function direEnter(index) {
		console.log(index)
		if (index == 0) {
			window.location.href = './carrousel.html?id=' + TV.GetParam('id')+"&type=getVoteOption" ;
		} else if (index == 1) { //暂停滚动
			clearInterval(articleRun)
		}else if(index == 2){
			var params = {
				id: TV.GetParam('id'),
				name: EVM.cookie.getValue('TV_CST_NAME'),
				mobile: EVM.cookie.getValue('TV_CST_MOBILE'),
				// access_token: $.cookie('TV_CST_TOKEN'),
			}
			GetDatas('articleLike', params, function (err, res) {
					resOpt.call(this, res)
				});
		}
	}

	function resOpt(res) {
		// console.log(res)
		if (res.code == 0) {
			TV.PromptMsg("点赞成功");
			$("#likes p").html(res.data.likes)

		} else if (res.code == 10002) {
			TV.userLogin();
			direEnter(index);
		} else {
			TV.PromptMsg(res.message)
		}
	}
</script>
<script type="text/javascript" src="js/index.js"></script>

</html>